VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"
Begin VB.Form frmINV100 
   BackColor       =   &H8000000D&
   Caption         =   " INV100"
   ClientHeight    =   7665
   ClientLeft      =   915
   ClientTop       =   870
   ClientWidth     =   10140
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   7665
   ScaleWidth      =   10140
   Begin MSAdodcLib.Adodc Adodc6 
      Height          =   495
      Left            =   360
      Top             =   720
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   873
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc6"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Frame Frame2 
      BorderStyle     =   0  'None
      Height          =   4695
      Left            =   720
      TabIndex        =   57
      Top             =   1920
      Width           =   5775
      Begin VB.TextBox txtRCPWG 
         Height          =   375
         Left            =   4440
         TabIndex        =   76
         Top             =   360
         Width           =   1095
      End
      Begin VB.TextBox txtRCVUM 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "VNI-Helve"
            Size            =   11.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   4320
         TabIndex        =   71
         Top             =   3840
         Width           =   735
      End
      Begin VB.TextBox txtRCVPU 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "VNI-Helve"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3600
         TabIndex        =   70
         Top             =   3840
         Width           =   615
      End
      Begin VB.TextBox txtRCED3 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "VNI-Helve-Condense"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   405
         Left            =   3120
         TabIndex        =   63
         Top             =   2520
         Width           =   1935
      End
      Begin VB.TextBox txtRCED2 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "VNI-Helve-Condense"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   405
         Left            =   3120
         TabIndex        =   62
         Top             =   1920
         Width           =   1935
      End
      Begin VB.TextBox txtRCED1 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "VNI-Helve-Condense"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   405
         Left            =   2400
         TabIndex        =   61
         Top             =   1320
         Width           =   2655
      End
      Begin VB.TextBox txtRCITD 
         Height          =   375
         Left            =   1440
         TabIndex        =   60
         Top             =   360
         Width           =   2895
      End
      Begin VB.TextBox txtRCITN 
         Height          =   375
         Left            =   120
         TabIndex        =   59
         Top             =   360
         Width           =   1215
      End
      Begin VB.PictureBox Picture1 
         DrawMode        =   11  'Not Xor Pen
         Height          =   1500
         Left            =   480
         Picture         =   "frmINV100.frx":0000
         ScaleHeight     =   1
         ScaleMode       =   0  'User
         ScaleWidth      =   0.948
         TabIndex        =   58
         Top             =   1320
         Width           =   1425
      End
      Begin VB.Label Label21 
         Alignment       =   2  'Center
         Caption         =   "PRODUCT OF"
         Height          =   255
         Left            =   480
         TabIndex        =   79
         Top             =   2880
         Width           =   1575
      End
      Begin VB.Label Label20 
         Alignment       =   2  'Center
         Caption         =   "LABEL"
         BeginProperty Font 
            Name            =   "VNI-Helve-Condense"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   78
         Top             =   960
         Width           =   615
      End
      Begin VB.Label Label19 
         Caption         =   "Packing Weight"
         Height          =   255
         Left            =   4440
         TabIndex        =   77
         Top             =   120
         Width           =   1215
      End
      Begin VB.Label Label18 
         Caption         =   "Item Descriprtion"
         Height          =   255
         Left            =   1440
         TabIndex        =   75
         Top             =   120
         Width           =   2895
      End
      Begin VB.Label Label17 
         Caption         =   "Item"
         Height          =   255
         Left            =   120
         TabIndex        =   74
         Top             =   120
         Width           =   1215
      End
      Begin VB.Label Label16 
         Caption         =   "????"
         Height          =   375
         Left            =   2400
         TabIndex        =   73
         Top             =   3840
         Width           =   735
      End
      Begin VB.Label Label15 
         Caption         =   "????"
         Height          =   495
         Left            =   840
         TabIndex        =   72
         Top             =   3840
         Width           =   495
      End
      Begin VB.Line Line5 
         X1              =   5280
         X2              =   5280
         Y1              =   1200
         Y2              =   4440
      End
      Begin VB.Line Line3 
         X1              =   240
         X2              =   240
         Y1              =   1200
         Y2              =   4440
      End
      Begin VB.Label Label14 
         Caption         =   "QUANTITY"
         Height          =   375
         Left            =   3840
         TabIndex        =   69
         Top             =   3600
         Width           =   1095
      End
      Begin VB.Line Line1 
         X1              =   240
         X2              =   5280
         Y1              =   1200
         Y2              =   1200
      End
      Begin VB.Label Label12 
         Caption         =   "SIAM BROTHERS"
         BeginProperty Font 
            Name            =   "VNI-Helve-Condense"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   480
         TabIndex        =   67
         Top             =   3120
         Width           =   1815
      End
      Begin VB.Label Label11 
         Caption         =   "PRODUCT OF"
         Height          =   255
         Left            =   720
         TabIndex        =   66
         Top             =   2400
         Width           =   1095
      End
      Begin VB.Label Label10 
         Caption         =   "GROSS WEIGHT"
         Height          =   375
         Left            =   2040
         TabIndex        =   65
         Top             =   3600
         Width           =   1455
      End
      Begin VB.Label Label1 
         Caption         =   "NET WEIGHT"
         Height          =   375
         Left            =   600
         TabIndex        =   64
         Top             =   3600
         Width           =   1215
      End
      Begin VB.Line Line4 
         X1              =   240
         X2              =   5280
         Y1              =   4440
         Y2              =   4440
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      Caption         =   "Frame1"
      Height          =   5175
      Left            =   240
      TabIndex        =   10
      Top             =   1920
      Width           =   9720
      Begin VB.TextBox txtIMITN 
         Height          =   375
         Left            =   1560
         TabIndex        =   56
         Top             =   240
         Width           =   1935
      End
      Begin VB.TextBox txtIMITD 
         Enabled         =   0   'False
         Height          =   288
         Left            =   6552
         Locked          =   -1  'True
         TabIndex        =   32
         Top             =   84
         Width           =   2988
      End
      Begin VB.TextBox txtIMETD 
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "VNI-Times"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   6552
         Locked          =   -1  'True
         TabIndex        =   31
         Top             =   516
         Width           =   2988
      End
      Begin VB.TextBox txtIMWPU 
         Enabled         =   0   'False
         Height          =   288
         Left            =   6570
         Locked          =   -1  'True
         TabIndex        =   30
         Top             =   1725
         Width           =   1116
      End
      Begin VB.TextBox txtIMPER 
         Enabled         =   0   'False
         Height          =   288
         Left            =   6552
         Locked          =   -1  'True
         TabIndex        =   29
         Top             =   2220
         Width           =   1116
      End
      Begin VB.TextBox txtIMATC 
         Enabled         =   0   'False
         Height          =   288
         Left            =   6570
         Locked          =   -1  'True
         TabIndex        =   28
         Top             =   2700
         Width           =   1116
      End
      Begin VB.TextBox txtIMSDC 
         Enabled         =   0   'False
         Height          =   288
         Left            =   1560
         Locked          =   -1  'True
         TabIndex        =   24
         Top             =   2580
         Width           =   1116
      End
      Begin VB.TextBox txtIMVPU 
         Enabled         =   0   'False
         Height          =   288
         Left            =   1560
         Locked          =   -1  'True
         TabIndex        =   23
         Top             =   2145
         Width           =   1116
      End
      Begin VB.TextBox txtIMWUM 
         Enabled         =   0   'False
         Height          =   288
         Left            =   1560
         Locked          =   -1  'True
         TabIndex        =   22
         Top             =   1755
         Width           =   1215
      End
      Begin VB.TextBox txtIMPRC 
         Enabled         =   0   'False
         Height          =   288
         Left            =   1560
         Locked          =   -1  'True
         TabIndex        =   21
         Top             =   3060
         Width           =   1116
      End
      Begin VB.TextBox txtIMROU 
         Enabled         =   0   'False
         Height          =   288
         Left            =   1560
         Locked          =   -1  'True
         TabIndex        =   20
         Top             =   3510
         Width           =   1116
      End
      Begin VB.TextBox txtIMLTM 
         Enabled         =   0   'False
         Height          =   288
         Left            =   1560
         Locked          =   -1  'True
         TabIndex        =   19
         Top             =   4035
         Width           =   1116
      End
      Begin VB.TextBox txtIMLSZ 
         Enabled         =   0   'False
         Height          =   288
         Left            =   6570
         Locked          =   -1  'True
         TabIndex        =   18
         Top             =   3060
         Width           =   1116
      End
      Begin VB.TextBox txtIMOPC 
         Enabled         =   0   'False
         Height          =   288
         Left            =   6552
         Locked          =   -1  'True
         TabIndex        =   17
         Top             =   3465
         Width           =   1116
      End
      Begin VB.TextBox txtIMVDC 
         Enabled         =   0   'False
         Height          =   288
         Left            =   6552
         Locked          =   -1  'True
         TabIndex        =   16
         Top             =   3900
         Width           =   1116
      End
      Begin VB.TextBox txtIMBSZ 
         Enabled         =   0   'False
         Height          =   288
         Left            =   1575
         Locked          =   -1  'True
         TabIndex        =   15
         Top             =   4545
         Width           =   1116
      End
      Begin VB.TextBox txtIMVTC 
         Enabled         =   0   'False
         Height          =   288
         Left            =   6540
         Locked          =   -1  'True
         TabIndex        =   14
         Top             =   4320
         Width           =   1140
      End
      Begin VB.CheckBox chkIMLOT 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00E0E0E0&
         Caption         =   "Have Lot"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Left            =   4875
         TabIndex        =   13
         Top             =   4725
         Width           =   1890
      End
      Begin VB.TextBox txtIMPGC 
         Enabled         =   0   'False
         Height          =   288
         Left            =   1680
         Locked          =   -1  'True
         TabIndex        =   11
         Top             =   1800
         Width           =   1092
      End
      Begin MSDataListLib.DataCombo cboIMVTC 
         Bindings        =   "frmINV100.frx":12DA
         Height          =   315
         Left            =   6540
         TabIndex        =   12
         Top             =   4320
         Width           =   1395
         _ExtentX        =   2461
         _ExtentY        =   556
         _Version        =   393216
         ListField       =   "VTDSC"
         BoundColumn     =   "VTVTP"
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo cboIMUMC 
         Bindings        =   "frmINV100.frx":12EF
         Height          =   288
         Left            =   6552
         TabIndex        =   25
         Top             =   1320
         Width           =   3012
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Enabled         =   0   'False
         Locked          =   -1  'True
         ListField       =   "UMDSC"
         BoundColumn     =   "UMUMC"
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo cboIMCLC 
         Bindings        =   "frmINV100.frx":1304
         Height          =   285
         Left            =   6540
         TabIndex        =   26
         Top             =   930
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Enabled         =   0   'False
         Locked          =   -1  'True
         ListField       =   "CLDSC"
         BoundColumn     =   "CLCLC"
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo cboIMTYP 
         Bindings        =   "frmINV100.frx":1319
         Height          =   285
         Left            =   1560
         TabIndex        =   27
         Top             =   855
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Enabled         =   0   'False
         Locked          =   -1  'True
         ListField       =   "TPDSC"
         BoundColumn     =   "TPTYP"
         Text            =   ""
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Item No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   2
         Left            =   135
         TabIndex        =   54
         Top             =   240
         Width           =   765
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Description"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   228
         Index           =   3
         Left            =   4932
         TabIndex        =   53
         Top             =   156
         Width           =   1092
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Extra Description"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   228
         Index           =   4
         Left            =   4932
         TabIndex        =   52
         Top             =   564
         Width           =   1620
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Item Type"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   252
         Index           =   5
         Left            =   60
         TabIndex        =   51
         Top             =   960
         Width           =   1452
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Item Class"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   228
         Index           =   6
         Left            =   4932
         TabIndex        =   50
         Top             =   1032
         Width           =   1044
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "U/M Code"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   264
         Index           =   8
         Left            =   4932
         TabIndex        =   49
         Top             =   1416
         Width           =   984
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Weight U.M."
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   9
         Left            =   60
         TabIndex        =   48
         Top             =   1800
         Width           =   795
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Wgt.Per Unit"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   228
         Index           =   10
         Left            =   4896
         TabIndex        =   47
         Top             =   1824
         Width           =   1200
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Vol.Per Unit"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   270
         Index           =   11
         Left            =   60
         TabIndex        =   46
         Top             =   2205
         Width           =   1110
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Cost Per Wgt Or Unt"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   390
         Index           =   12
         Left            =   4890
         TabIndex        =   45
         Top             =   2205
         Width           =   1005
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Standard Cst"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   13
         Left            =   45
         TabIndex        =   44
         Top             =   2640
         Width           =   1200
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Actual Cst"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   14
         Left            =   4860
         TabIndex        =   43
         Top             =   2790
         Width           =   1200
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "List price"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   270
         Left            =   60
         TabIndex        =   42
         Top             =   3075
         Width           =   915
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "Recorder level"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   270
         Left            =   60
         TabIndex        =   41
         Top             =   3540
         Width           =   1395
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "Lead time days"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   255
         Left            =   60
         TabIndex        =   40
         Top             =   4065
         Width           =   1335
      End
      Begin VB.Label Label5 
         BackStyle       =   0  'Transparent
         Caption         =   "Lot size"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   255
         Left            =   4905
         TabIndex        =   39
         Top             =   3105
         Width           =   1215
      End
      Begin VB.Label Label6 
         BackStyle       =   0  'Transparent
         Caption         =   "Order policy"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   255
         Left            =   4890
         TabIndex        =   38
         Top             =   3465
         Width           =   1215
      End
      Begin VB.Label Label7 
         BackStyle       =   0  'Transparent
         Caption         =   "Vender code"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   375
         Left            =   4890
         TabIndex        =   37
         Top             =   3900
         Width           =   1095
      End
      Begin VB.Label Label8 
         BackStyle       =   0  'Transparent
         Caption         =   "Batch size"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   285
         Left            =   75
         TabIndex        =   36
         Top             =   4545
         Width           =   1050
      End
      Begin VB.Label Label9 
         BackStyle       =   0  'Transparent
         Caption         =   "VAT code"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   372
         Left            =   4896
         TabIndex        =   35
         Top             =   4320
         Width           =   1212
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Prod.group code"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   255
         Index           =   7
         Left            =   60
         TabIndex        =   34
         Top             =   1380
         Width           =   1455
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "1 . Weight   2 . Unit"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   390
         Index           =   16
         Left            =   7740
         TabIndex        =   33
         Top             =   2190
         Width           =   1005
      End
   End
   Begin ComctlLib.TabStrip TabStrip1 
      Height          =   5655
      Left            =   120
      TabIndex        =   55
      Top             =   1440
      Width           =   9975
      _ExtentX        =   17595
      _ExtentY        =   9975
      _Version        =   327682
      BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7} 
         NumTabs         =   2
         BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7} 
            Caption         =   "Detail"
            Object.Tag             =   $"frmINV100.frx":132E
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab2 {0713F341-850A-101B-AFC0-4210102A8DA7} 
            Caption         =   "Label"
            Object.Tag             =   ""
            ImageVarType    =   2
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc5 
      Height          =   390
      Left            =   7800
      Top             =   60
      Visible         =   0   'False
      Width           =   2070
      _ExtentX        =   3651
      _ExtentY        =   688
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "5 VAT Code"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc4 
      Height          =   372
      Left            =   2880
      Top             =   0
      Visible         =   0   'False
      Width           =   2052
      _ExtentX        =   3625
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc4"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc3 
      Height          =   330
      Left            =   5400
      Top             =   120
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc3"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   375
      Left            =   7560
      Top             =   720
      Visible         =   0   'False
      Width           =   2130
      _ExtentX        =   3757
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc2"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   372
      Left            =   7200
      Top             =   240
      Visible         =   0   'False
      Width           =   1212
      _ExtentX        =   2143
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton cmdDelete 
      Caption         =   "&Delete"
      Height          =   372
      Left            =   5760
      TabIndex        =   9
      Top             =   7128
      Width           =   960
   End
   Begin MSDataListLib.DataCombo cboIMITN 
      Bindings        =   "frmINV100.frx":1339
      Height          =   315
      Left            =   3960
      TabIndex        =   7
      Top             =   960
      Width           =   3450
      _ExtentX        =   6085
      _ExtentY        =   556
      _Version        =   393216
      ListField       =   "IMITD"
      BoundColumn     =   "IMITN"
      Text            =   ""
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "&Exit"
      Height          =   372
      Left            =   6780
      TabIndex        =   6
      Top             =   7128
      Width           =   1080
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "&Cancel"
      Height          =   372
      Left            =   4668
      TabIndex        =   5
      Top             =   7128
      Width           =   1032
   End
   Begin VB.CommandButton cmdSave 
      Caption         =   "&Save"
      Height          =   372
      Left            =   3600
      TabIndex        =   4
      Top             =   7128
      Width           =   984
   End
   Begin VB.CommandButton cmdEdit 
      Caption         =   "&Edit"
      Height          =   372
      Left            =   2592
      TabIndex        =   3
      Top             =   7128
      Width           =   948
   End
   Begin VB.CommandButton cmdAddnew 
      Caption         =   "&New Item"
      Height          =   372
      Left            =   1512
      TabIndex        =   2
      Top             =   7128
      Width           =   996
   End
   Begin VB.Label Label13 
      Caption         =   "GROSS WEIGHT"
      Height          =   375
      Left            =   4320
      TabIndex        =   68
      Top             =   5040
      Width           =   1455
   End
   Begin VB.Line Line2 
      X1              =   0
      X2              =   4680
      Y1              =   0
      Y2              =   0
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "Select Item Review"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0080FFFF&
      Height          =   228
      Index           =   15
      Left            =   2124
      TabIndex        =   8
      Top             =   1080
      Width           =   1776
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "Item Master Mainternent"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   16.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   492
      Index           =   1
      Left            =   2028
      TabIndex        =   1
      Top             =   372
      Width           =   4800
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "INV100"
      BeginProperty Font 
         Name            =   "VNI-Present"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   492
      Index           =   0
      Left            =   12
      TabIndex        =   0
      Top             =   0
      Width           =   1680
   End
End
Attribute VB_Name = "frmINV100"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim OldIMITN As String
Private mintCurFrame As Integer ' Current Frame visible

Private Sub Control(GT As Variant)
    cboIMTYP.Enabled = GT
    txtIMWUM.Enabled = GT
    txtIMVPU.Enabled = GT
    txtIMSDC.Enabled = GT
    txtIMITD.Enabled = GT
    txtIMETD.Enabled = GT
    txtIMWPU.Enabled = GT
    txtIMPER.Enabled = GT
    txtIMATC.Enabled = GT
    cboIMCLC.Enabled = GT
    cboIMUMC.Enabled = GT
    txtIMPGC.Enabled = GT
   ' txtIMITN.Enabled = GT
    txtIMPRC.Enabled = GT
    txtIMLSZ.Enabled = GT
    txtIMROU.Enabled = GT
    txtIMOPC.Enabled = GT
    txtIMLTM.Enabled = GT
    txtIMVDC.Enabled = GT
    txtIMBSZ.Enabled = GT
    txtIMVTC.Enabled = GT
    txtRCED1.Enabled = GT
    txtRCED2.Enabled = GT
    txtRCED3.Enabled = GT
    txtRCVPU.Enabled = GT
    txtRCVUM.Enabled = GT
    txtRCPWG.Enabled = GT
    
    
    cboIMTYP.Locked = Not GT
    txtIMWUM.Locked = Not GT
    txtIMVPU.Locked = Not GT
    txtIMSDC.Locked = Not GT
    txtIMITD.Locked = Not GT
    txtIMETD.Locked = Not GT
    txtIMWPU.Locked = Not GT
    txtIMPER.Locked = Not GT
    txtIMATC.Locked = Not GT
    cboIMCLC.Locked = Not GT
    cboIMUMC.Locked = Not GT
    txtIMPGC.Locked = Not GT
    'txtIMITN.Locked = Not GT
    txtIMPRC.Locked = Not GT
    txtIMLSZ.Locked = Not GT
    txtIMROU.Locked = Not GT
    txtIMOPC.Locked = Not GT
    txtIMLTM.Locked = Not GT
    txtIMVDC.Locked = Not GT
    txtIMBSZ.Locked = Not GT
    txtIMVTC.Locked = Not GT
    txtRCED1.Locked = Not GT
    txtRCED2.Locked = Not GT
    txtRCED3.Locked = Not GT
    txtRCVPU.Locked = Not GT
    txtRCVUM.Locked = Not GT
    txtRCPWG.Locked = Not GT
    cboIMITN.Enabled = Not GT
    cboIMITN.Locked = GT
End Sub
Private Sub cboIMCLC_Click(Area As Integer)
If Area = 2 Then
  ' txtIMCLC = cboIMCLC.BoundText
  ' txtCLDSC = cboIMCLC.Text
End If
End Sub

Private Sub cboIMCLC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    cboIMUMC.SetFocus
End If

End Sub

Private Sub cboIMITN_Change()
    txtIMITN = cboIMITN.BoundText
    txtRCITN = cboIMITN.BoundText
    ISEDITING = False
    ButtonStatus
    WriteToScreen (1)
    'cboIMITN.SelStart = 1
 cboIMITN.SelLength = 0
End Sub

Private Sub cboIMITN_Click(Area As Integer)

If Area = 2 Then
    txtIMITN = cboIMITN.BoundText
    ISEDITING = False
    ButtonStatus
    WriteToScreen (1)
   ' cboIMITN.SelStart = 1
cboIMITN.SelLength = 0
End If
End Sub

Private Sub cboIMTYP_Click(Area As Integer)
If Area = 2 Then
    txtIMPGC.SetFocus
End If
End Sub

Private Sub cboIMTYP_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMPGC.SetFocus
End If
End Sub

Private Sub cboIMUMC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMWPU.SetFocus
    
End If

End Sub

Private Sub cboIMVTC_Click(Area As Integer)
If Area = 2 Then
    txtIMVTC = cboIMVTC.BoundText
    chkIMLOT.SetFocus
End If
End Sub

Private Sub cboIMVTC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    chkIMLOT.SetFocus
End If
End Sub

Private Sub chkIMLOT_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    cmdSave.SetFocus
    
End If

End Sub

Private Sub cmdAddnew_Click()

ISADDING = True
ISEDITING = True
WriteToScreen (0)
Control (True)
' Ham Gan tri man hinh
ButtonStatus
'Frame1.Visible = True
'Frame2.Visible = False

txtIMITN.SetFocus
End Sub

Private Sub cmdCancel_Click()
' Gan tri man nhinh
ISADDING = False
ISEDITING = False
Control (False)
ButtonStatus
txtIMITN = cboIMITN.BoundText
WriteToScreen (1)
cmdAddnew.SetFocus
End Sub

Private Sub cmdDelete_Click()
ISADDING = False
ISEDITING = False
' Ham delete theo Item chon
Dim sql As String
'SQL = "DELETE FROM IIM where imitn = '" & cboIMITN.BoundText & "'"
sql = "Update IIM set IMRID='IZ' where imitn = '" & cboIMITN.BoundText & "'"
DBconn.Execute (sql)
Adodc4.Refresh
WriteToScreen (0)
ButtonStatus

End Sub

Private Sub cmdEdit_Click()
ISEDITING = True
' Ham gan tri man hinh
ISADDING = False
ISEDITING = True
Control (True)

ButtonStatus
End Sub

Private Sub cmdexit_Click()
Unload frmINV100
End Sub
Private Sub WriteToScreen(tri As Byte)
If tri = 0 Then 'gan rong
        txtIMITN = ""
        cboIMTYP.BoundText = ""
        txtIMWUM = ""
        txtIMVPU = 0
        txtIMSDC = 0
        txtIMITD = ""
        txtIMETD = ""
        cboIMCLC.BoundText = "'"
        cboIMUMC.BoundText = ""
        txtIMWPU = 0
        txtIMPER = ""
        txtIMATC = 0
        txtIMPRC = 0
        txtIMLSZ = 0
        txtIMROU = 0
        txtIMOPC = ""
        txtIMLTM = 0
        txtIMVDC = 0
        txtIMBSZ = 0
        txtIMVTC = ""
        txtIMPGC = ""
        txtIMVTC = ""
        cboIMVTC = ""
        chkIMLOT.value = 0
        txtRCED1 = ""
        txtRCED2 = ""
        txtRCED3 = ""
        txtRCVPU = 0
        txtRCVUM = ""
        txtRCPWG = 0
Else
        Dim TBL, recIRC As ADODB.Recordset
        Set TBL = New ADODB.Recordset
        Set recIRC = New ADODB.Recordset
        TBL.Open "  Select IIM.* From IIM where  IMITN ='" & txtIMITN & "'", DBconn, adOpenKeyset, adLockOptimistic, adCmdText
        recIRC.Open "  Select IRC.* From IRC where  IMITN ='" & txtIMITN & "'", DBconn, adOpenKeyset, adLockOptimistic, adCmdText
        If recIRC.EOF = False Then
            txtRCED1 = IIf(IsNull(recIRC!IMED1), "", recIRC!IMED1)
            txtRCED2 = IIf(IsNull(recIRC!IMED2), "", recIRC!IMED2)
            txtRCED3 = IIf(IsNull(recIRC!IMED3), "", recIRC!IMED3)
            txtRCVPU = IIf(IsNull(recIRC!IMVPU), "", recIRC!IMVPU)
            txtRCVUM = IIf(IsNull(recIRC!IMVUM), "", recIRC!IMVUM)
            txtRCPWG = IIf(IsNull(recIRC!IMPWG), 0, recIRC!IMPWG)
            recIRC.Close
        Else
            txtRCED1 = ""
            txtRCED2 = ""
            txtRCED3 = ""
            txtRCVPU = 0
            txtRCVUM = ""
            txtRCPWG = 0
            recIRC.Close
        End If
        If TBL.EOF = False Then
            
            'txtIMITN = IIf(IsNull(TBL!imitn), "", TBL!imitn)
            cboIMITN.BoundText = txtIMITN
            cboIMTYP.BoundText = IIf(IsNull(TBL!imtyp), "", TBL!imtyp)
            txtIMWUM = IIf(IsNull(TBL!imwum), "", TBL!imwum)
            txtIMVPU = IIf(IsNull(TBL!IMVPU), "", TBL!IMVPU)
            txtIMSDC = IIf(IsNull(TBL!imsdc), "", TBL!imsdc)
            txtIMITD = IIf(IsNull(TBL!IMITD), "", TBL!IMITD)
            txtRCITD = IIf(IsNull(TBL!IMITD), "", TBL!IMITD)
            txtIMETD = IIf(IsNull(TBL!imetd), "", TBL!imetd)
            cboIMCLC.BoundText = IIf(IsNull(TBL!imclc), "", TBL!imclc)
            cboIMUMC.BoundText = IIf(IsNull(TBL!imumc), "", TBL!imumc)
            txtIMWPU = IIf(IsNull(TBL!IMWPU), "", TBL!IMWPU)
            txtIMPER = IIf(IsNull(TBL!IMPER), "", TBL!IMPER)
            txtIMATC = IIf(IsNull(TBL!IMATC), "", TBL!IMATC)
            txtIMPRC = IIf(IsNull(TBL!imprc), "", TBL!imprc)
            txtIMLSZ = IIf(IsNull(TBL!imlsz), "", TBL!imlsz)
            txtIMROU = IIf(IsNull(TBL!imrou), "", TBL!imrou)
            txtIMOPC = IIf(IsNull(TBL!IMOPC), "", TBL!IMOPC)
            txtIMLTM = IIf(IsNull(TBL!imltm), "", TBL!imltm)
            txtIMVDC = IIf(IsNull(TBL!imvdc), "", TBL!imvdc)
            txtIMBSZ = IIf(IsNull(TBL!imbsz), "", TBL!imbsz)
            txtIMVTC = IIf(IsNull(TBL!IMVTC), "", TBL!IMVTC)
            txtIMPGC = IIf(IsNull(TBL!IMPGC), "", TBL!IMPGC)
            txtIMVTC = IIf(IsNull(TBL!IMVTC), "", TBL!IMVTC)
            cboIMVTC.BoundText = IIf(IsNull(TBL!IMVTC), "", TBL!IMVTC)
            chkIMLOT.value = IIf(TBL!IMLOT, 1, 0)
        Else
            txtIMITN = ""
            cboIMTYP.BoundText = ""
            txtIMWUM = ""
            txtIMVPU = 0
            txtIMSDC = 0
            txtIMITD = ""
            txtIMETD = ""
            cboIMCLC.BoundText = "'"
            cboIMUMC.BoundText = ""
            txtIMWPU = 0
            txtIMPER = ""
            txtIMATC = 0
            txtIMPRC = 0
            txtIMLSZ = 0
            txtIMROU = 0
            txtIMOPC = ""
            txtIMLTM = 0
            txtIMVDC = 0
            txtIMBSZ = 0
            txtIMVTC = ""
            txtIMVTC = ""
            cboIMVTC.BoundText = ""
            chkIMLOT.value = 0
        End If
        TBL.Close
End If
OldIMITN = txtIMITN
End Sub
Private Sub WriteToFile(tri As Byte)
Dim SQLInsert As String
If tri = 0 Then
    SQLInsert = " INSERT INTO IIM " & _
      "(IMITN,IMTYP,IMWUM,IMVPU,IMSDC,IMITD,IMCLC,IMUMC,IMWPU,IMPER" & _
      ",IMATC,IMPRC,IMLSZ,IMROU,IMOPC,IMLTM,IMVDC,IMBSZ,IMVTC,IMETD,IMPGC" & _
      ",IMOBU,IMRCU,IMISU,IMAJU,IMSLU,IMOOU,IMCOU,IMALU,IMYSU,IMYIU" & _
      ",IMOBW,IMRCW,IMISW,IMAJW,IMSLW,IMOOW,IMCOW,IMALW,IMYSW,IMYIW" & _
      ",IMLOT,IMRID,IMLDT,IMLUS,IMTSQ,IMWSQ) " & _
    "VALUES " & _
      "('" & txtIMITN & "', '" & cboIMTYP.BoundText & "', '" & txtIMWUM & _
      "', " & Val(txtIMVPU) & ", " & Val(txtIMSDC) & ", '" & txtIMITD & _
      "', '" & cboIMCLC.BoundText & "', '" & cboIMUMC.BoundText & "', " & _
      Val(txtIMWPU) & ", '" & Left(txtIMPER, 3) & "', " & Val(txtIMATC) & ", " & _
      Val(txtIMPRC) & ", " & Val(txtIMLSZ) & ", " & Val(txtIMROU) & ", '" & _
      Left(txtIMOPC, 1) & "', " & Val(txtIMLTM) & ", " & Val(txtIMVDC) & ", " & _
      Val(txtIMBSZ) & ", '" & txtIMVTC & "', '" & txtIMETD & "', '" & Left(txtIMPGC, 5) & "'" & _
      ",0,0,0,0,0,0,0,0,0,0" & _
      ",0,0,0,0,0,0,0,0,0,0," & _
      chkIMLOT.value & ",'IM','" & Format(Now(), "yyyy-mm-dd hh:mm:ss") & "','" & UserLogin & "',0,0)"
      DBconn.Execute SQLInsert
      SQLInsert = "Insert into IRC " & _
      "(IMITN,IMITD,IMED1,IMED2,IMED3,IMVPU,IMVUM,IMPWG)" & _
      "VALUES " & _
      "('" & txtIMITN & "', '" & txtIMITD & "', '" & txtRCED1 & "', '" & txtRCED2 & "', '" & txtRCED3 & _
      "', '" & txtRCVPU & "', '" & txtRCVUM & "', '" & txtRCPWG & "')"
      DBconn.Execute SQLInsert
Else
    SQLInsert = "UPDATE IIM SET " & _
        "IMITN ='" & txtIMITN & "', IMTYP ='" & cboIMTYP.BoundText & "', " & _
        "IMWUM ='" & txtIMWUM & "', IMVPU =" & Val(txtIMVPU) & ", " & _
        "IMSDC = " & Val(txtIMSDC) & ", IMITD = '" & txtIMITD & "', " & _
        "IMCLC ='" & cboIMCLC.BoundText & "', IMUMC ='" & cboIMUMC.BoundText & "', " & _
        "IMWPU =" & Val(txtIMWPU) & ", IMPER = '" & Left(txtIMPER, 3) & "', " & _
        "IMATC =" & Val(txtIMATC) & ", IMPRC =" & Val(txtIMPRC) & ", " & _
        "IMLSZ =" & Val(txtIMLSZ) & ", IMROU =" & Val(txtIMROU) & ", " & _
        "IMOPC ='" & Left(txtIMOPC, 1) & "', IMLTM =" & Val(txtIMLTM) & ", " & _
        "IMVDC = " & Val(txtIMVDC) & ", IMBSZ =" & Val(txtIMBSZ) & ", " & _
        "IMVTC ='" & txtIMVTC & "', IMETD ='" & txtIMETD & "', " & _
        "IMPGC = '" & Left(txtIMPGC, 5) & "',IMLOT=" & chkIMLOT.value & _
        ",IMLDT='" & Format(Now(), "yyyy-mm-dd hh:mm:ss") & "',IMLUS='" & UserLogin & "'" & _
        " WHERE IMITN ='" & OldIMITN & "'"
    DBconn.Execute SQLInsert
    
    '///////////////////////////////////
      
        Set recIRC = New ADODB.Recordset
        recIRC.Open "  Select IRC.* From IRC where  IMITN ='" & txtIMITN & "'", DBconn, adOpenKeyset, adLockOptimistic, adCmdText
        If recIRC.EOF = False Then
           SQLInsert = "UPDATE IRC set " & _
          "IMITN='" & txtIMITN & "',IMITD='" & txtIMITD & _
          "',IMED1='" & txtRCED1 & "',IMED2='" & txtRCED2 & "',IMED3='" & txtRCED3 & "',IMVPU='" & txtRCVPU & "',IMVUM='" & txtRCVUM & "',IMPWG='" & txtRCPWG & "' " & _
          " WHERE IMITN ='" & OldIMITN & "'"
            DBconn.Execute SQLInsert
            recIRC.Close
        Else
            SQLInsert = "Insert into IRC " & _
            "(IMITN,IMITD,IMED1,IMED2,IMED3,IMVPU,IMVUM,IMPWG)" & _
            "VALUES " & _
            "('" & txtIMITN & "', '" & txtIMITD & "', '" & txtRCED1 & "', '" & txtRCED2 & "', '" & txtRCED3 & _
            "', '" & txtRCVPU & "', '" & txtRCVUM & "', '" & txtRCPWG & "')"
            DBconn.Execute SQLInsert
            recIRC.Close
        End If
    
    
    
End If

'DBconn.Execute SQLInsert

End Sub
Private Sub cmdSave_Click()
' Ham Save tri vao file
Dim tbl_ChapNhan As ADODB.Recordset
Set tbl_ChapNhan = New ADODB.Recordset
tbl_ChapNhan.Open "  Select IIM.* From IIM ", DBconn, adOpenKeyset, adLockOptimistic, adCmdText
tbl_ChapNhan.Close
If ISADDING = False Then
    WriteToFile (1)
Else
    WriteToFile (0)
End If
Adodc4.Refresh
Control (False)
'''''''''''
ISADDING = False
ISEDITING = False

ButtonStatus
cmdAddnew.SetFocus
End Sub

Private Sub Form_Load()
BIENCHUNG
Adodc1.ConnectionString = ConnectString
Adodc1.ConnectionTimeout = 10
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "ICL" 'ITEM CLASSE
Adodc1.Refresh

Adodc2.ConnectionString = ConnectString
Adodc2.ConnectionTimeout = 10
Adodc2.CommandType = adCmdTable
Adodc2.RecordSource = "ITP" 'ITEM type
Adodc2.Refresh

Adodc3.ConnectionString = ConnectString
Adodc3.ConnectionTimeout = 10
Adodc3.CommandType = adCmdTable
Adodc3.RecordSource = "IUM" 'unit of measure
Adodc3.Refresh

Adodc4.ConnectionString = ConnectString
Adodc4.ConnectionTimeout = 10
Adodc4.CommandType = adCmdText
Adodc4.RecordSource = "Select IMITN,IMITN +' : ' +IMITD   as IMITD from IIM where IMRID <>'IZ' order by imitn" 'unit of measure
Adodc4.Refresh

Adodc5.ConnectionString = ConnectString
Adodc5.ConnectionTimeout = 10
Adodc5.CommandType = adCmdTable
Adodc5.RecordSource = "VVT" 'unit of measure
Adodc5.Refresh
'Adodc6.ConnectionString = ConnectString
'Adodc6.ConnectionTimeout = 10
'Adodc6.CommandType = adCmdTable
'Adodc6.RecordSource = "IRC" 'Label
'Adodc6.Refresh
ISADDING = False
ISEDITING = False
ButtonStatus
Frame2.Visible = False
End Sub

Sub ButtonStatus()
cmdAddnew.Enabled = Not ISEDITING
cmdEdit.Enabled = Not ISEDITING
cmdSave.Enabled = ISEDITING ' And txtIMITN <> ""
cmdDelete.Enabled = Not ISEDITING 'And txtIMITN <> ""
CmdCancel.Enabled = ISEDITING
'txtIMITN.Locked = Not ISADDING ' Lock item code tru truong hop ISADDING=true
Frame1.Enabled = ISEDITING
'txtDepartment.Enabled = ISEDITING
'cboDepartment.Visible = Not ISADDING
'txtDepartmentID.Visible = ISADDING
End Sub


Private Sub TabStrip1_Click()
If TabStrip1.SelectedItem.Index = 1 Then  ' No need to change frame.
   ' Otherwise, hide old frame, show new.
   Frame1.Visible = True
   Frame2.Visible = False
   If ISEDITING = False Then
        cmdAddnew.Enabled = True
    End If
Else
    
    
    'Control (True)
' Ham Gan tri man hinh
   cmdAddnew.Enabled = False

   Frame1.Visible = False
   Frame2.Visible = True
   ' Set mintCurFrame to new value.
  ' mintCurFrame = TabStrip1.SelectedItem.Index
 End If
End Sub

Private Sub txtIMATC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMLSZ.SetFocus
    
End If

End Sub

Private Sub txtIMBSZ_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMITD.SetFocus
    
End If

End Sub

Private Sub txtIMETD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    cboIMCLC.SetFocus
    
End If

End Sub

Private Sub txtIMITD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMETD.SetFocus
    
End If

End Sub

Private Sub txtIMITN_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If ISEDITING Then
         If ValidMaso(OldIMITN, txtIMITN, "IIM", " IMITN='" & txtIMITN & "'") Then
            MsgBox "This code is already exist"
            txtIMITN.SetFocus
        Else
           cboIMTYP.SetFocus
        End If
   Else
        'txtIMITN = cboIMITN.BoundText
       ' ISEDITING = False
       If Find("IIM", "IMITN", " WHERE IMITN='" & txtIMITN & "'") = "" Then
            MsgBox "This Item doesn't exist"
            cboIMITN.SetFocus
            Exit Sub
       End If
       
        ButtonStatus
        WriteToScreen (1)
   End If
End If
End Sub

Private Sub txtIMLSZ_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMOPC.SetFocus
End If

End Sub

Private Sub txtIMLTM_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMBSZ.SetFocus
    
End If

End Sub

Private Sub txtIMOPC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMVDC.SetFocus
    
End If

End Sub

Private Sub txtIMPER_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMATC.SetFocus
    
End If

End Sub

Private Sub txtIMPGC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMWUM.SetFocus
    
End If

End Sub

Private Sub txtIMPRC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMROU.SetFocus
    
End If

End Sub

Private Sub txtIMROU_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMLTM.SetFocus
    
End If

End Sub

Private Sub txtIMSDC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMPRC.SetFocus
    
End If

End Sub

Private Sub txtIMVDC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    cboIMVTC.SetFocus
    
End If

End Sub

Private Sub txtIMVPU_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMSDC.SetFocus
    
End If

End Sub

Private Sub txtIMWPU_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMPER.SetFocus
    
End If

End Sub

Private Sub txtIMWUM_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtIMVPU.SetFocus
    
End If

End Sub
